//
//  SKUDefultQuestionTBCell.m
//  ZITHER
//
//  Created by weixin on 2018/8/17.
//  Copyright © 2018年 weixn. All rights reserved.
//

#import "SKUDefultQuestionTBCell.h"

@implementation SKUDefultQuestionTBCell

- (void)awakeFromNib {
    
    [super awakeFromNib];
    
    [self.viewBack setCornerRadiusWithRadius:15 isMasks:YES];
    [self.viewBack setBorderWithColor:[UIColor RGBColorWithR:224 g:224 b:224] width:1];
    [self.viewBack addSubview:self.scrollview];

}


//-(void)setIndexCell:(NSInteger)index{
//
//    if (index== 0) {
//
//        self.merchantImage.hidden = NO;
//
//        self.merchantName.hidden = NO;
//
////        [self.viewBack setBorderWithColor:[UIColor RGBColorWithR:255 g:170 b:160] width:1];
////        self.labTakein.text = @"3个接受到的报价";
////        NSString *str = [NSString stringWithFormat:@"%@个接受到的报价",self.model.acceptPriceCount];
////        self.labTakein.text = str;//接受报价
////        self.price.text = self.model.acceptPrice;//价格
////        str = [NSString stringWithFormat:@"%@%@",RootUrlImage,self.model.acceptBizPortrait];
////        [self.merchantImage sd_setImageWithURL:[NSURL URLWithString:str]] ;//商家头像
////        self.merchantName.text = self.model.acceptBizNickName;//商家名称
//
//        if (self.model.acceptFileList.count>0) {
////            self.viewText.text = self.model.receiveSourceDesc;
//            CGRect frame = self.viewText.frame;
//            frame.size.height = [NSString textHeight:self.viewText.text font:17 width:self.viewText.width];
//            self.viewText.frame = frame;
//
//            self.scrollview.frame = CGRectMake(0,CGRectGetMaxY(self.viewText.frame)+10 , kScreenW-30,60);
//            self.scrollview.hidden = NO;
//            [self.scrollview.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
//            self.scrollview.contentSize = CGSizeMake(self.model.acceptFileList.count*68+15,0);
//
//            for (int j = 0; j<self.model.acceptFileList.count; j++) {
//                UIImageView * imageV = [[UIImageView alloc]initWithFrame:CGRectMake(j*68+15,0, 60,60)];
//                [imageV setCornerRadiusWithRadius:5 isMasks:YES];
//                imageV.backgroundColor = [UIColor whiteColor];
//                imageV.contentMode = UIViewContentModeScaleAspectFill;
//
//                NSString *str = [NSString stringWithFormat:@"%@%@",RootUrlImage,self.model.acceptFileList[j]];
//
//                [imageV sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"watchSmale"]];
//
//                [self.scrollview addSubview:imageV];
//            }
//
//        }else{
//            self.scrollview.hidden = YES;
//        }
//
//
//    }else if (index == 1) {
//
//
////        self.merchantImage.hidden = YES;
////        self.merchantName.hidden = YES;
////        [self.viewBack setBorderWithColor:[UIColor RGBColorWithR:224 g:224 b:224] width:1];
////        NSString *str = [NSString stringWithFormat:@"%@个收到的报价",self.model.receivePriceCount];
////        self.labTakein.text = str;//接受报价
////        self.price.text = self.model.receivePrice;//价格
////
////
////        self.viewText.text = self.model.acceptSourceDesc;
////        CGRect frame = self.viewText.frame;
////        frame.size.height = [NSString textHeight:self.viewText.text font:17 width:self.viewText.width];
//        self.viewText.frame = frame;
//
//        if (self.model.receiveFileList.count>0) {
//
//
//            self.scrollview.frame = CGRectMake(0,CGRectGetMaxY(self.viewText.frame)+10 , kScreenW-30,60);
//            self.scrollview.frame = CGRectMake(0,CGRectGetMaxY(self.viewText.frame)+30 , kScreenW-30,60);
//            self.scrollview.hidden = NO;
//            [self.scrollview.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
//            self.scrollview.contentSize = CGSizeMake(self.model.receiveFileList.count*68+15,0);
//
//            for (int j = 0; j<self.model.receiveFileList.count; j++) {
//                UIImageView * imageV = [[UIImageView alloc]initWithFrame:CGRectMake(j*68+15,0, 60,60)];
//                [imageV setCornerRadiusWithRadius:5 isMasks:YES];
//                imageV.backgroundColor = [UIColor whiteColor];
//                imageV.contentMode = UIViewContentModeScaleAspectFill;
//
//                NSString *str = [NSString stringWithFormat:@"%@%@",RootUrlImage,self.model.receiveFileList[j]];
//
//                [imageV sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"watchSmale"]];
//
//                [self.scrollview addSubview:imageV];
//            }
//
//        }else{
//            self.scrollview.hidden = YES;
//        }
//    }else{
//
////        self.viewText.text = self.model.sourceDesc;
////        CGRect frame = self.viewText.frame;
////        frame.size.height = [NSString textHeight:self.viewText.text font:15 width:kScreenW-36];
////        self.viewText.frame = frame;
////
////        self.merchantImage.hidden = YES;
////        self.merchantName.hidden = YES;
////        [self.viewBack setBorderWithColor:[UIColor RGBColorWithR:224 g:224 b:224] width:1];
////        NSString *str = [NSString stringWithFormat:@"%@个更多的公开货源",self.model.openSourceCount];
////        self.viewText.text = self.model.sourceDesc;
////        self.labTakein.text = str;//接受报价
////        self.price.text = self.model.receivePrice;//价格
//
//
//
//        if (self.model.fileList.count>0) {
//
//            self.scrollview.frame = CGRectMake(0,CGRectGetMaxY(self.viewText.frame)+30 , kScreenW-30,60);
//            self.scrollview.hidden = NO;
//            [self.scrollview.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
//            self.scrollview.contentSize = CGSizeMake(self.model.fileList.count*68+15,0);
//
//            for (int j = 0; j<self.model.fileList.count; j++) {
//                UIImageView * imageV = [[UIImageView alloc]initWithFrame:CGRectMake(j*68+15,0, 60,60)];
//                [imageV setCornerRadiusWithRadius:5 isMasks:YES];
//                imageV.backgroundColor = [UIColor whiteColor];
//                imageV.contentMode = UIViewContentModeScaleAspectFill;
//
//                NSString *str = [NSString stringWithFormat:@"%@%@",RootUrlImage,self.model.fileList[j]];
//
//                [imageV sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"watchSmale"]];
//
//                [self.scrollview addSubview:imageV];
//            }
//
//        }else{
//            self.scrollview.hidden = YES;
//        }
//    }
//
//
//
//    //     //接受报价货源图片
//    //     //收到报价货源图片
//    //     //公开货源图片
//
//
//
//
//}


-(UIScrollView *)scrollview{
    if (!_scrollview) {
        _scrollview = [[UIScrollView alloc]initWithFrame:CGRectMake(0,CGRectGetMaxY(self.viewText.frame)+35 , kScreenW,60)];
        _scrollview.bounces = NO;
        _scrollview.showsHorizontalScrollIndicator = NO;
        _scrollview.contentSize = CGSizeMake(kScreenW*3,0);
        _scrollview.bounces = NO; // 默认为YES 取消设置NO
        // 当bounces属性为NO时，以下两个属性设置无效
        _scrollview.alwaysBounceHorizontal = YES; // 水平方向弹簧效果
        _scrollview.alwaysBounceVertical = YES; // 垂直方向弹簧效果
        _scrollview.decelerationRate = 0.1; // 值域 0~1 值越小减速停止的时间越短
        _scrollview.backgroundColor = [UIColor randomColor];
        
    }
    return _scrollview;
}


@end

